<?php require('pre.inc'); ?>

<h1>SPARQL Endpoint</h1>

<p>Our public SPARQL (<a href="http://en.wikipedia.org/wiki/SPARQL">what is
this?</a>) endpoint can be used to query all the Linked Data published on
this site. The endpoint is available at the address <a
href="http://data.aalto.fi/sparql">http://data.aalto.fi/sparql</a></p>

<p>Each source dataset is stored in a distinct named graph. The default
graph contains all data, so unless you specify a graph explicitly using
GRAPH, you will automatically access everything.</p>

<h2>Query Test Form</h2>

<form action="sparql" method="GET"  accept-charset="UTF-8">
  <textarea name="query" cols="70" rows="20">
prefix xsd: <http://www.w3.org/2001/XMLSchema#> 
prefix dct: <http://purl.org/dc/terms/> 
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix skos: <http://www.w3.org/2004/02/skos/core#> 
prefix bibo: <http://purl.org/ontology/bibo/> 
prefix foaf: <http://xmlns.com/foaf/0.1/> 
prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> 
prefix aiiso:<http://purl.org/vocab/aiiso/schema#>
prefix teach:<http://linkedscience.org/teach/ns#>  
  
SELECT ?class (COUNT(?s) AS ?count ) {
  ?s a ?class .
} 
GROUP BY ?class 
ORDER BY ?count
</textarea>
  <br/>

  Output: <select name="output">
    <option value="xml">XML/XHTML</option>
    <option value="json">JSON</option>
    <option value="text">Text</option>
    <option value="csv">CSV</option>
    <option value="tsv">TSV</option>
  </select>
  <br/>
  <input type="checkbox" name="force-accept" value="text/plain"/>
  Force the accept header to <tt>text/plain</tt> regardless 
      <br/>
      <input type="submit" value="Get Results" />
  <input type="hidden" name="stylesheet" size="20" value="xml-to-html.xsl" />
</form>

<?php require('post.inc'); ?>
